package cn.juforg.guns;

import java.util.HashMap;

import android.media.SoundPool;

public abstract class Gun {
	public SoundPool soundPool;
	public HashMap<Integer, Integer> motion2sound = new HashMap<Integer, Integer>();
	public HashMap<String,Integer> motionMap = new HashMap<String,Integer>();
	public int posture = -1;
	
	public static class GunMotion {
		public static final int NO_MOTION = 0;
	}
	public static class MotionKey {
		private int[] key;

		public MotionKey(int[] key) {
			super();
			this.key = key;
		}

		@Override
		public boolean equals(Object o) {
			return this.hashCode()==o.hashCode();
		}

		@Override
		public int hashCode() {
			StringBuilder hascode = new StringBuilder() ;
			for (int e : key) {
				hascode.append(e);
			}
			return hascode.toString().hashCode();
		}
		
	}
	
}
